package cn.edu.ctbu.studentmanage.controller;
import cn.edu.ctbu.studentmanage.domain.Dept;
import cn.edu.ctbu.studentmanage.domain.Lecture;
import cn.edu.ctbu.studentmanage.service.DeptService;
import cn.edu.ctbu.studentmanage.service.LectureService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class DeptController {

    @Autowired
    private DeptService deptService;

    @RequestMapping("deptindex")
    public String list(Model model){
        List<Dept> depts = deptService.findAll();
        model.addAttribute("data",depts);
        return "deptindex";
    }

}